package com.tjbklx1.zk.testzkclient;

import org.I0Itec.zkclient.ZkClient;
import org.I0Itec.zkclient.serialize.SerializableSerializer;
import org.apache.zookeeper.CreateMode;

public class CreateNode {
	
	public static void main(String[] args) {
		ZkClient client = new ZkClient("127.0.0.1:2181", 1000,1000, new SerializableSerializer());
		System.out.println("connect ok");
		
		User u = new User();
		u.setId(1);
		u.setName("test");
		
		String path = client.create("/cli", u, CreateMode.PERSISTENT);
		System.out.println(path);
		
	}
}
